import request from '@/utils/request'

/**
 * 获取列表
 *
 * @param params
 */
export function listPageRole(params) {
  return request({
    url: '/system/roles',
    method: 'get',
    params: params
  })
}

/**
 * 保存信息
 *
 * @param data
 */
export function saveRoles(data) {
  return request({
    url: '/system/roles',
    method: 'post',
    data: data
  })
}

/**
 * 删除
 *
 * @param id
 */
export function delRoles(roleId) {
  return request({
    url: '/system/roles/' + roleId,
    method: 'delete'
  })
}

/**
 * 删除
 *
 * @param id
 */
export function listRoleMenu(roleId) {
  return request({
    url: '/system/roles/' + roleId,
    method: 'get'
  })
}

/**
 * 删除
 *
 * @param id
 */
export function saveRoleMenu(data) {
  return request({
    url: '/system/rolePages/' ,
    method: 'post',
    data: data
  })
}

export function listRoles() {
  return request({
    url: '/system/roles/list',
    method: 'get'
  })
}
